home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / datescrn.arc / SET_TIME.C < prev    next >
Text File  |  1985-12-12  |  896b  |  37 lines

  1. /*  set_time()  */
  2. /*  This function performs a system function call to set the system */
  3. /*  time with the hours & monutes passed.  */
  4.  
  5. set_time(hours, minutes)
  6. int hours, minutes;
  7.  
  8. #define SET_TIME  0x2D
  9. #define byte char
  10. #define ONE   1
  11. #define TWO   2
  12. #define THREE 3
  13. #define FOUR  4
  14. #define FIVE  5
  15. #define SIX   6
  16. #define SEVEN 7
  17.  
  18. {
  19.  
  20.      int hold_yr;
  21.      struct  XREG {short ax, bx, cx, dx, si, di;};
  22.      struct  HREG {byte  al, ah, bl, bh, cl, ch, dl, dh;};
  23.      union   REGS {
  24.                struct  XREG x;
  25.                struct  HREG h;
  26.      } inregs, outregs;
  27.  
  28.      inregs.h.ch = hours;
  29.      inregs.h.cl = minutes;
  30.      inregs.h.dh = 0;
  31.      inregs.h.dl = 0;
  32.      
  33.      inregs.h.ah = SET_TIME;
  34.      inregs.h.al = 0;
  35.      intdos(&inregs, &outregs);
  36. }
  37.